import 'dart:ui';

import 'package:flutter/widgets.dart';

class Const {
  //**************其它常量**************
  //static const BASE_HOST = "http://192.168.0.106"; //host
  static const BASE_HOST = "http://106.13.70.118"; //baidu
  static const UPLOAD_FILE = "file"; //上传文件名称
  static const IMG_PATH = "/"; //显示图片url拼接字段
  static const TEST_TOKEN = "TEST_TOKEN_0903";
  static const IMG_SIZE_HEAD = 188;
  static const IMG_SIZE_PIC = 640;
  static const IMG_SIZE_NOTE = 218;
  static const PAGE_SIZE = 10;

  static const SPACE_NULL = 0;
  static const SPACE_TOP = 1;
  static const SPACE_BOTTOM = 2;
  static const SPACE_LEFT = 3;
  static const SPACE_RIGHT = 4;

  //**************SP常量**************
  static const SP_TOKEN = "token";
  static const SP_USERNAME = "username";

  //**************返回code**************
  static const SUCCESS = 1; //成功
  static const FAIL = 0; //失败
  static const ERROR_USERNAME = -1; //账号错误
  static const ERROR_PASSWORD = -2; //密码错误
  static const FAIL_NONE = -3; //不存在
  static const FAIL_REQUEST = -4; //请求异常
  static const NET_ERROR = -101; //没有网络
  static const SERVER_ERROR = -111; //连接不到服务器

  //************API************
  static const String API_UPDATE_ACCOUNT ="/api/updateAccount";//更改账户信息
  static const API_REGISTER = "/api/register"; //注册
  static const API_LOGIN = "/api/login"; //登录
  static const API_UPDATE_USER = "/api/updateUser"; //更新用户
  static const API_ALL_USER = "/api/allUser"; //获取全部用户
  static const API_GET_USER = "/api/getUser"; //根据id获取单个用户
  static const API_FRIEND_RELATION ="/api/friendRelation";//好友关系

  static const API_ADD_BOOK = "/api/addBook"; //添加日记本
  static const API_DELETE_BOOK = "/api/deleteBook"; //删除日记本
  static const API_UPDATE_BOOK = "/api/updateBook"; //更新日记本
  static const API_GET_BOOK_LIST = "/api/getBookList"; //根据uid获取日记本列表
  static const API_GET_BOOK = "/api/getBook"; //根据bid获取单个日记本

  static const API_ADD_NOTE = "/api/addNote"; //添加日记
  static const API_DELETE_NOTE = "/api/deleteNote"; //删除日记
  static const API_UPDATE_NOTE = "/api/updateNote"; //更新日记
  static const API_GET_NOTE_LIST =
      "/api/getNoteList"; //获取日记列表20条(传入最后一条时间,不传bid所有人的日记,传bid则是日记本内的日记)
  static const API_GET_NOTE = "/api/getNote"; //根据nid获取日记

  static const API_GET_MARK ="/api/getMark";//查询是否关注日记
  static const API_ADD_MARK = "/api/addMark"; //关注日记
  static const API_DELETE_MARK = "/api/deleteMark"; //取消关注
  static const API_GET_MARK_NOTE_LIST = "/api/getMarkNoteList"; //根据uid获取关注的日记列表

  static const API_ADD_COMMENT = "/api/addComment"; //发表评论
  static const API_DELETE_COMMENT = "/api/deleteComment"; //删除评论
  static const API_UPDATE_COMMENT = "/api/updateComment"; //更新评论
  static const API_GET_COMMENT_LIST = "/api/getCommentList"; //根据nid获取评论列表
  static const API_GET_COMMENT = "/api/getComment"; //根据cid获取评论

  static const API_UPLOAD = "/api/upload"; //上传文件
}

class icon {
  static const IconData th_list = const IconData(0xe800, fontFamily: 'MyFlutterApp');
}
class color {
  static const bg_page = const Color(0xFFf1f1f1);
  static const bg_item = const Color(0xFFEEEEEE);
  static const white = const Color(0xFFffffff);
  static const pink = const Color(0xFFee5588);
  static const green = const Color(0xFF4caf50);
  static const green_light = const Color(0xDDE0F8E0);
  static const line = const Color(0xFFcccccc);
  static const txt3 = const Color(0xFF333333);
  static const txt6 = const Color(0xFF666666);
  static const txt9 = const Color(0xFF999999);
  static const grey = const Color(0xFF888888);
  static const a6_grey = const Color(0x66666666);
  static const transparent = const Color(0x00ffffff);
}

class dim {
  static const t12 = 12.0;
  static const t14 = 14.0;
  static const t16 = 16.0;
  static const t18 = 18.0;
  static const t20 = 20.0;
  static const t22 = 22.0;
  static const t24 = 24.0;
  static const x01 = 0.5;
  static const x1 = 1.0;
  static const x2 = 2.0;
  static const x5 = 5.0;
  static const x10 = 10.0;
  static const x15 = 15.0;
  static const x20 = 20.0;
  static const x30 = 30.0;
  static const x35 = 35.0;
  static const x40 = 40.0;
  static const x45 = 45.0;
  static const x50 = 50.0;
  static const x60 = 60.0;
  static const x80 = 80.0;
  static const x85 = 85.0;
  static const x100 = 100.0;
  static const x125 = 125.0;
  static const x150 = 150.0;
  static const x200 = 200.0;
  static const x250 = 250.0;
  static const x300 = 300.0;
  static const x360 = 360.0;
  static const x380 = 380.0;
  static const x420 = 420.0;
  static const x450 = 450.0;
  static const x500 = 500.0;
}
